var app = getApp();
var util = require("../../utils/libs.js")
var api = require("../../utils/api.js")
Page({
  data: {
    message:{
      image:'',
      message:''
    },
    uid:""
  },
  onLoad (options) {
    let that = this
    let uid = wx.getStorageSync("uid")
    that.setData({
      uid:uid
    })
    that.getmessageList()
    // 页面初始化 options为页面跳转所带来的参数
  },
  getmessageList(){
    let that = this
    util.request(api.messageList,{
     uid:that.data.uid
    },"GET")
    .then(function (res) {
      if(res.error_code === 0){
          that.setData({
            message:res.data.list
          })
      }
    })
  },
  onReady () {
    // 页面渲染完成
  },
  onShow () {
    // 页面显示
  },
  onHide () {
    // 页面隐藏

  },
  onUnload () {
    // 页面关闭

  }
})
